package com.android.phoenix.bluetooth;

import com.android.phoenix.R;
import com.android.phoenix.activity.SportActivity;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.Service;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ImageView;
import android.widget.TextView;

public class BluConnectFailActivity extends Activity {
	private ImageView title_Imgbtn_left_up;
	private TextView title_txt_center;
	private Button but_blutooth_try_again;
	private BluetoothDevice device;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.acti_blutooth_connect_fail);
		// 初始化一些控件
		initView();
		// 初始化titleBar
		initTitleBar();				
	}
	/**
	 * 
	 * @Title: initTitleBar
	 * @Description: TODO(设置统一的titleBar)
	 * @author: wWX230766
	 * @date: 2015-1-6 下午10:00:48
	 */
	private void initTitleBar() {
		title_Imgbtn_left_up = (ImageView) this
				.findViewById(R.id.title_Imgbtn_left_up);
		title_txt_center = (TextView) this.findViewById(R.id.title_txt_center);
		title_txt_center.setText(R.string.label_blutooth_connect);
		title_Imgbtn_left_up.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent it = new Intent();
				it.setClass(BluConnectFailActivity.this, SportActivity.class);
				startActivity(it);
				finish();
			}
		});
	}

	private void initView()
	{
		final Intent intent =  this.getIntent();
		intent.setClass(this, BluetoothConnectActivity.class);
		but_blutooth_try_again = (Button)findViewById(R.id.but_blutooth_try_again);		
		but_blutooth_try_again.setOnClickListener(new OnClickListener() {	
			@Override
			public void onClick(View view) {
				// TODO Auto-generated method stub
				startActivity(intent);
				finish();
			}
		});
	}
}
